#include "TextStreamFake.h"

Factory < TextStreamInterface > TextStreamFake::factory;

TextStreamFakePtr TextStreamFake::Spawn ()
{
	return factory.CreateNewObject < TextStreamFake > ();
}

void TextStreamFake::CheckInnocence ()
{
	assert ( factory.ObjectsCount () == 0 );
}

char TextStreamFake::ReadChar ()
{
	assert ( ! readChars.empty () );
	char result = readChars.at ( 0 );
	readChars = readChars.substr ( 1 );
	return result;
}

void TextStreamFake::WriteString ( std::string str )
{
	written += str;
}
